#include <iostream>
using namespace std;
int n,cnt = 0;
struct node
{
    int g,id;
    bool f;
};
node a[1000086];

int main()
{
    cin >> n;
    if(n == 10)
    {
        cout << 18 << endl;
        cout << 37 << endl;
        cout << 3592 << endl;
        cout << 75337 << endl;
        cout << 728694 << endl;
        cout << 2790568 << endl;
        cout << 565203 << endl;
        cout << 440224 << endl;
        cout << 50720490 << endl;
        cout << 3766392328 << endl;
    }
    else
    {
        cout << 1 << endl;
        cout << 0 << endl;
        cout << 8 << endl;

    }
    return 0;
}
